# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-altair
pkgver=5.3.0
pkgrel=1
pkgdesc="Declarative statistical visualization library for Python"
url="https://altair-viz.github.io"
arch="noarch"
license="BSD-3-Clause"
depends="
	python3
	py3-jinja2
	py3-jsonschema
	py3-numpy
	py3-pandas
	py3-toolz
	py3-packaging
	py3-typing-extensions
	"
checkdepends="black py3-pytest"
makedepends="py3-gpep517 py3-hatchling"
subpackages="$pkgname-pyc"
source="https://github.com/altair-viz/altair/archive/v$pkgver/altair-$pkgver.tar.gz"
builddir="$srcdir/altair-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	# some tests require dataset: https://github.com/altair-viz/vega_datasets
	local _skipped_tests="
		test_examples
		and not test_api
		and not test_display
		and not test_params
		and not test_vegalite_compiler
		and not test_to_dict_with_format_vega
		and not test_to_json_with_format_vega
		and not test_renderer_with_none_embed_option
		and not test_jupyter_renderer_mimetype"

	# shellcheck disable=SC2116
	python3 -m pytest -k "not $(echo $_skipped_tests)" \
		--ignore=tests/utils/test_schemapi.py \
		--ignore=tests/test_jupyter_chart.py \
		--ignore=tests/test_transformed_data.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/altair-$pkgver-py3-none-any.whl
}

sha512sums="
c60f16d82dcc6784fcec7425f6c3f874a8f71f0e200d6e095b73fed3c3a720bfde13d7227fee9b8cfa06d1b93a207fbda8ca5d4a0df5f6b2532fb9954d828229  altair-5.3.0.tar.gz
"
